package com.leanyuan.check.controller;

import com.leanyuan.check.domain.TAdmin;
import com.leanyuan.check.dto.TRoledto;
import com.leanyuan.check.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/leanyuan/TAdmin")
public class TAdminControllerOne {

    @Autowired
    TAdminServiceOne tAdminServiceOne;

    @Autowired
    TAdminsServiceOne tAdminsServiceOne;
    @Autowired
    TActionServiceOne tActionServiceOne;
    @Autowired
    TRoleServiceOne tRoleServiceOne;
    @Autowired
    TRolesServiceOne tRolesServiceOne;

    //分页查询
    @RequestMapping("FindAllTAdmin")
    public List<TAdmin> FindAll(Model model){
        List<TAdmin> list= tAdminServiceOne.list(null);
        model.addAttribute("userlist",list);
        return list;
    }

    @RequestMapping("FindAllRole")
    public List<TRoledto> FindRole(Model model){
        List<TRoledto> list=tRoleServiceOne.selectTRole();
        model.addAttribute("userlist",list);
        return list;
    }

}